#include <iostream>
#include <string>

using namespace std;

/*
匿名对象的特点

- 短生命周期

- 简化代码

- 自动销毁

*/
class Time
{
private:
    static int hour;
    static int min;
    static int sec;

public:
    // 显示时间
    void show_Time() const
    {
        cout << "我是常成员函数" << endl;
        this->hour = 10;
        cout << this->hour << ":" << this->min << ":" << this->sec << endl;
    }

    static int set_Time(int m_hour, int m_min, int m_sec)
    {
        hour = m_hour;
        min = m_min;
        sec = m_sec;
    }
};

// 静态成员变量 类外初始化
int Time::hour = 10;
int Time::min = 10;
int Time::sec = 10;



int main(int argc, char const *argv[])
{
    // 匿名对象

    Time T1;
    Time T2;

    T1.set_Time(80 , 90 , 100);
    
    T2.show_Time();
    return 0;
}
